﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

using System.ComponentModel;
using System.Windows.Navigation;
using Common.Library;
using OnlineVideos.UI;
using OnlineMovies.UserControls;
using OnlineVideos;
//using MyToolkit.Multimedia;
using OnlineVideos.Utilities;
using Common.Utilities;

namespace OnlineMovies.Views
{
    public partial class MoviesFavorites : PhoneApplicationPage
    {
        private SolidColorBrush adcontrolborder = new SolidColorBrush(Colors.Transparent);
        public MoviesFavorites()
        {
            InitializeComponent();
        }
           

        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.LogEvent("MoviesFavorites Page", true);
                LoadAds();
                
            }
            catch (Exception ex)
            {
                Exceptions.SaveOrSendExceptions("Exception in PhoneApplicationPage_Loaded Method In MoviesFavorites file.", ex);
            }
        }
        private void LoadAds()
        {
            try
            {
                PageHelper.LoadAdControl(FavoriteGrid, adstackplFavorites, 1);
            }
            catch (Exception ex)
            {
                Exceptions.SaveOrSendExceptions("Exception in LoadAds Method In SongDetails file", ex);
                string excepmess = "Exception in LoadAds Method In SongDetails file.\n\n" + ex.Message + "\n\n StackTrace :- \n" + ex.StackTrace;
            }
        }
        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.EndTimedEvent("MoviesFavorites Page");
            }
            catch (Exception ex)
            {

                Exceptions.SaveOrSendExceptions("Exception in OnNavigatedFrom Method In MoviesFavorites.cs file.", ex);
            }
     
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.LogPageView();
            }
            catch (Exception ex)
            {

                Exceptions.SaveOrSendExceptions("Exception in OnNavigatedTo Method In MoviesFavorites.cs file.", ex);
            }
            //YouTube.CancelPlay();
        }

        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            //if (YouTube.CancelPlay())
            //    e.Cancel = true;
            //else
            //{

            //}
            base.OnBackKeyPress(e);
        }

        private void imgTitle_MouseEnter(object sender, MouseEventArgs e)
        {
            NavigationService.Navigate(NavigationHelper.MainPanoramaPage);
        }
         
    }
}